<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的订单</title><script type="text/javascript">
	function changePage(method) {
		var pageNo = document.forms[0].pageNo.value;
		var total = document.forms[0].total.value;
		if (method == "next") {
			if (parseInt(pageNo) >= parseInt(total)) {
				alert("当前已经是最后一页！");
				return false;
			} else {
				document.forms[0].pageNo.value = parseInt(pageNo) + 1;
			}
		}
		if (method == "previous") {
			if (parseInt(pageNo) <= 1) {
				alert("当前已经是第一页");
				return false;
			} else {
				document.forms[0].pageNo.value = parseInt(pageNo) - 1;
			}
		}
		if (method == "first") {
			document.forms[0].pageNo.value = 1;
		}
		if (method == "end") {
			document.forms[0].pageNo.value = total;
		}

		document.forms[0].submit();
	}
</script>
</head>
<body>

			<form action="<c:url value='/UserInfoAction?oper=myOrder'/>" method="post">
					<input type="hidden" name="pageNo" value="${pageNo}"> 
					<input type="hidden" name="total" value="${total}"> 
			</form>
			<div style="float:right;">
		欢迎您:<a href="<c:url value='/UserInfoAction?oper=personaledit&id=${userInfologin.id}'/>">${userInfologin.userName }</a>
	</div>
<div style="width:800px;height:50px;">
	
	<ul class="nav nav-pills">
  <li><a href="<c:url value='/ClothingAction?oper=defaultlist'/>">首页</a></li>
   <li><a href="<c:url value='/BuycarAction?oper=list'/>">我的购物车</a></li>
   <li  class="active"><a href="<c:url value='UserInfoAction?oper=myOrder'/>">我的订单</a></li>
   <li><a href="<c:url value='/UserInfoAction?oper=loginout'/>">退出登录</a></li>
</ul>
</div>
<div class="clearfix"></div>


<table class="table">
   <thead>
      <tr>
         <th>订单编号</th>
         <th>总价</th>
         <th>是否付款</th>
         <th>是否发货</th>
         <th>下单时间</th>
      </tr>
   </thead>
   <tbody>
   	<c:forEach items="${orderInfolist }" var="orderInfo">
      <tr class="success">
        <td>${orderInfo.id }</td>
				<td>${totalprice }￥</td>
				<c:if test="${orderInfo.isPay==0 }">
				<td>未支付</td>
				</c:if>
				<c:if test="${orderInfo.isPay!=0 }">
				<td>已经付款</td>
				</c:if>
				<c:if test="${orderInfo.isDeliver==0 }">
				<td>未发货</td>
				</c:if>
				<c:if test="${orderInfo.isDeliver!=0 }">
				<td>已经发货</td>
				</c:if>
				<td>${orderInfo.orderTime}</td>
				<td>
				<a href="<c:url value='/OrderAction?oper=list&id=${orderInfo.id }'/>">订单明细</a>
				</td>
      	</tr>
      </c:forEach>
   </tbody>
</table>
			<div class="text-center">
			查询到：${count}条记录
			<a href="#" onclick="changePage('first')">首页</a> 
			<a href="#" onclick="changePage('previous')">上一页</a> 
			<a href="#" onclick="changePage('next')">下一页</a>
			 第${ pageNo}页/共${total}页
			<a href="#" onclick="changePage('end')">尾页</a>
			</div>
	
</body>
</html>